<template>
    <div class="yemian">
      <div class="dingbu">
        <div class="biaoti">
          <img src="../../assets/image/纸飞机.png" class="tubiao">
          <span class="wz">NBM在线考试系统</span>
        </div>
        <XSCD />
        <div class="touxiang">
          <img src="../../assets/image/头型.png" style="height: 50px; width: 50px;">
          <UserInfo />
        </div>
      </div>
      
      <!-- 优化后的轮播图部分 -->
      <div class="LBT">
        <el-carousel 
          :interval="3000" 
          height="170px" 
          trigger="click" 
          arrow="never"
          indicator-position="outside"
          autoplay>
          <el-carousel-item v-for="(image, index) in images" :key="index">
            <img :src="image" class="carousel-image" />
          </el-carousel-item>
        </el-carousel>
      </div>
      <div class="lx" @click="lx">查看在线练习</div>
      <div class="zw">
        <div class="HY">
          <div class="subject-tabs">
          <div class="action-button publish-exam"  >
                  <div class="bj" @click="yw">
                      <img src="../../assets/image/13.png" style="width: 200px; height: 200px; " >
                      <div style="margin-left: 15px; font-size: 25px; margin-top: 20px; font-size: 60px; font-weight: 50px;">语  文</div>
                  </div>
          </div>
          <div class="vertical-line"></div>
          <div class="action-button publish-exam"  >
                  <div class="bj" @click="sx">
                      <img src="../../assets/image/14.png" style="width: 200px; height: 200px; ">
                      <div style="margin-left: 15px; font-size: 25px; margin-top: 20px; font-size: 60px; font-weight: 50px;">数  学</div>
                  </div>
          </div>
          <div class="vertical-line"></div>
          <div class="action-button publish-exam"  >
              <div class="bj" @click="yy">
                  <img src="../../assets/image/15.png" style="width: 200px; height: 200px; ">
                  <div style="margin-left: 15px; font-size: 25px; margin-top: 20px; font-size: 60px; font-weight: 50px;">英  语</div>
              </div>
          </div>
        </div>
        </div>
        <
      </div>
      
    </div>
  </template>
  
  <script setup>
  import { useRouter } from 'vue-router' 
  import XSCD from '../../components/XSCD.vue';
  import UserInfo from '../../components/UserInfo.vue';
  import { ref, computed } from 'vue';
  const router = useRouter()
  
  // 使用require确保图片正确加载
  const images = ref([
    new URL('../../assets/image/lb1.jpg', import.meta.url).href,
    new URL('../../assets/image/4.png', import.meta.url).href,
    new URL('../../assets/image/纸飞机.png', import.meta.url).href,
  ]);
  
  const yw = () => {
  router.push('/zxlxYW');
};
const sx = () => {
  router.push('/zxlxSX');
};
const yy = () => {
  router.push('/zxlxYY');
};
const lx = () => {
  router.push('/lxjl');
};
  </script>
  
  <style scoped>
  .yemian {
  width: 100%;
  min-height: 100vh;
  padding: 0 20px;
  box-sizing: border-box;
}

.dingbu {
  width: 100%;
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #e0e0e0;

  box-sizing: border-box;
}

.biaoti {
  display: flex;
  align-items: center;
  gap: 10px;
}

.tubiao {
  height: 40px;
  width: 40px;
}

.wz {
  color: #333;
  font-size: 24px;
  font-weight: bold;
}

.touxiang {
  display: flex;
  align-items: center;
  gap: 10px;
}

.LBT {
  width: 100%;
  height: 170px;
  margin: 20px 0;
}

.carousel-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
  .HY {
    width: 1400;
    font-size: 50px;
    padding-left: 70px;
  }
  
 
  .action-button {
   width: 300px;
   height: 300px;
   border-radius: 75%;
  padding-left: 80px;  
  }

  
  
  .bj{
    height: 340px;
    flex: 1;
    text-align: center;
    padding: 10px;
    cursor: pointer;
    transition: background-color 0.3s; 
    background-color: #F2F2F2;
    margin-right: 40px;
    border-radius: 8%;
    box-shadow: 
      3px 3px 0 0 rgba(0, 0, 0, 0.1),
      6px 6px 0 0 rgba(0, 0, 0, 0.05);
  }
  .bj:hover {
  transform: scale(1.05); /* 悬停放大效果 */
  }
  
  .bj.active {
    background-color: #007bff;
    color: white;
    border-color: #007bff;
  }
  .subject-tabs{
     
      height: 400px;
      display: flex;
      justify-content: center;
      margin-top: 25px;
      margin-right: 200px;
  }

  .vertical-line {
  width: 1px;
  height: 322px;
  background: #000;
}
.lx{
  text-align: right;
  margin-right: 100px;
  color: #1E98D7;
  cursor: pointer;
}
  </style>